//导入三方包文件
import Vue from 'vue'
import VueRouter from 'vue-router'

//导入文件
import Layout from "@/views/layout.vue"
import Findroom from "@/views/findroom.vue"
import User from "@/views/user.vue"
import Information from "@/views/information.vue"
import Homepage from "@/views/homepage.vue"
import Login from "@/views/login.vue"
import Register from "@/views/register.vue"
Vue.use(VueRouter)

const routes = [ 
  { name:"Login",
  path: "/login",
  component:Login
  },
  { name:"Register",
  path: "/register",
  component:Register
  },
  {
    
    path: "/",
    component: Layout,
    redirect:"/homepage",
    //二级路由
    children: [
      {
        path: "/findroom",
        component:Findroom
      },
      {
        path: "/user",
        component: User,
    
      },
      {
        path: "/information",
        component:Information
      },
      {
        path: "/homepage",
        component:Homepage
      },
      
    ],
   
  },
  
]

const router = new VueRouter({
  routes
})

export default router
